<?php
class Field {
	public $name;
	public $position;
	public $notNull;
	public $type;
	public $maxLength;
	public $default;
	public $isAI;
	public $isPK;
	
	public function getStatementType() {
		switch($this->type) {
			case 'tinyint':
			case 'smallint':
			case 'mediumint':
			case 'int':
			case 'bigint':
				return 'i';
			case 'real':
			case 'double':
			case 'float':
			case 'decimal':
				return 'd';
			case 'tinyblob':
			case 'mediumblob':
			case 'blob':
			case 'longblob':
				return 'b';
			default:
				return 's';
		}
	}
	
	public function __toString() {
		return $this->name;
	}
}
?>